package com.njwt.cloud.msconsumer.service;

import com.njwt.cloud.mscommon.pojo.OrderModel;
import com.njwt.cloud.msconsumer.service.hystrix.FeignOrderServiceFailure;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author <a href="mailto:xingxiao@gtmap.cn">xingxiaofeng</a>
 * @version2.1 2022-04-11
 * @description
 */
@FeignClient(value = "orders-provider",fallback = FeignOrderServiceFailure.class)
public interface OrderService {

    /***
     * 普通方式传递单个参数：get方式
     */
    @GetMapping("/order/params")
     String doParams01(@RequestParam("params") String params);
    /***
     * 普通方式传递单个参数：post方式
     */
    @PostMapping("/order/params")
     String doParams02(@RequestParam("params") String params);
     /***
     * rest风格传递单个参数：get方式
     */
    @GetMapping("/order/params/{params}")
     String doParams03(@PathVariable("params") String params) ;
    /***
     * rest风格传递单个参数：post方式
     */
    @PostMapping("/order/params/{params}")
     String doParams04(@PathVariable("params") String params);

    @RequestMapping(value = "/order/getOrder")
    OrderModel getOrder();

    @GetMapping("/order/getOrderById")
    OrderModel getOrderById(@RequestParam("orderid") String orderid);

    @GetMapping("/order/getOrderList")
    List<OrderModel> getOrderList(@RequestBody OrderModel orderModel);
}
